From: Eli Zaretskii Date: Sat, 20 Nov 2010 15:04:50 +0000 (+0200) Subject: Use \uNNNN, \UNNNNNN, or \xNNNNNN for hex-code display on a TTY. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~5594 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=a4a926a1a1dbe6136babcc39b1e62452e4a2f065;p=emacs.git Use \uNNNN, \UNNNNNN, or \xNNNNNN for hex-code display on a TTY. term.c (produce_glyphless_glyph): Use \uNNNN, \UNNNNNN, or \xNNNNNN for hex-code display of glyphless characters. --- diff --git a/src/ChangeLog b/src/ChangeLog index 514e63ac098..2023c5c86f7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-11-20 Eli Zaretskii + + * term.c (produce_glyphless_glyph): Use \uNNNN, \UNNNNNN, or + \xNNNNNN for hex-code display of glyphless characters. + 2010-11-20 Jan Djärv * gtkutil.c (xg_make_tool_item): Take vert_only as argument. diff --git a/src/term.c b/src/term.c index 4d452ed3e00..481a5d8853d 100644 --- a/src/term.c +++ b/src/term.c @@ -1936,7 +1936,7 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym) { int face_id; int len; - char buf[11], *str = " "; + char buf[9], *str = " "; /* Get a face ID for the glyph by utilizing a cache (the same way as done for `escape-glyph' in get_next_display_element). */ @@ -1987,10 +1987,9 @@ produce_glyphless_glyph (struct it *it, int for_no_font, Lisp_Object acronym) else { xassert (it->glyphless_method == GLYPHLESS_DISPLAY_HEX_CODE); - len = (it->c < 0x100 ? sprintf (buf, "[U+%02X]", it->c) - : it->c < 0x10000 ? sprintf (buf, "[U+%04X]", it->c) - : it->c <= MAX_UNICODE_CHAR ? sprintf (buf, "[U+%06X]", it->c) - : sprintf (buf, "[E+%06X]", it->c)); + len = (it->c < 0x10000 ? sprintf (buf, "\\u%04X", it->c) + : it->c <= MAX_UNICODE_CHAR ? sprintf (buf, "\\U%06X", it->c) + : sprintf (buf, "\\x%06X", it->c)); } str = buf; }